Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 2, 2025

reduces overhead when doing multiple curl requests per php-request.
starting with PHP 8.5 this even allows caching across php-requests.

other places which manually invoke curl_init can benefit in a similar way by adding such code. curl_multi_* will automatically share caches between requests, without the need for additional code.

we could also add CURL_LOCK_DATA_SSL_SESSION, but I was not sure whether this has security implications. therefore I left it out for now.

reduces overhead when doing multiple curl requests per php-request.

other places which manually invoke `curl_init` can benefit in a similar way by adding such code.
`curl_multi_*` will automatically share caches between requests, without the need for additional code.
@lesstif lesstif merged commit 9a36fe1 into lesstif:main Dec 28, 2025
1 of 2 checks passed
@staabm staabm deleted the share branch December 28, 2025 11:11
@mmethner
Copy link

mmethner commented Dec 30, 2025

This merge introduced an error between version 1.10.0 and 1.11.0:

`
PHP Warning: Undefined variable $share in ../vendor/lesstif/jira-cloud-restapi/src/JiraClient.php on line 174
Array
(
[type] => TypeError
[message] => curl_share_setopt(): Argument #1 ($share_handle) must be of type CurlShareHandle, null given
[file] => .../vendor/lesstif/jira-cloud-restapi/src/JiraClient.php
[line] => 174
[trace] => Array
(
[0] => .../vendor/lesstif/jira-cloud-restapi/src/JiraClient.php(174): curl_share_setopt()

        [1] => .../vendor/lesstif/jira-cloud-restapi/src/JiraClient.php(256): curlPrepare()

        [2] => .../vendor/lesstif/jira-cloud-restapi/src/Issue/IssueService.php(509): exec()

...
`

@staabm
Copy link
Contributor Author

staabm commented Dec 30, 2025

Ouch - you are right.

Let me fix that and setup PHPStan.

Can have a look later today

@mmethner
Copy link

Ouch - you are right.

Let me fix that and setup PHPStan.

Can have a look later today

There already is a PR to fix that issue. Its just the replacement of $share with $this->curlShare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants